﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class sendOutEmail : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
       
    }
    protected void ImgBtnSend_Click(object sender, ImageClickEventArgs e)
    {
        string filepath = FileUp.PostedFile.FileName;
        string filename = filepath.Substring(filepath.LastIndexOf("\\") + 1);
        if (FileUp.PostedFile.ContentLength > 40960)
        {
            LblMessage.Text = "文件大小不能超过网站配置文件中默认的40KB！";
        }
        else
        {
            string serverpath = Server.MapPath("AttachFiles/") + filename;
            FileUp.PostedFile.SaveAs(serverpath);
            LblMessage.Text = "恭喜您！邮件附件上传成功！";
        }
    }
}
